<template>
	<view v-show="show" class="" style="min-height: 400rpx;">
		<view class="tn-margin-sm">
			<view class="tn-text-lg tn-text-bold clamp-text-1 tn-text-justify">
				<text class="">测试分析</text>
			</view>
		</view>
		<qiun-data-charts  :gridCount="5"  type="radar" :opts="abilityOpts" :chartData="abilityChartData" />
	</view>
</template>

<script>
	export default {
		components: {},
		data() {
			return {
				show:false,
				max:100,
				
				abilityChartData: [],
				abilityOpts: {
					color: ["#4B98FE", "#00D05E", "#FFAC00", "#FB6A67", "#957BFE", "#00B9FE", "#FE871B", "#00C8B0",
						"#F674D6"
					],
					width:375,
					padding: [0,0,0,0],
					dataLabel: true,
					axisLabel : true,
					enableScroll: false,
					legend: {
						show: true,
						position: "left",
						lineHeight: 32
					},
					extra: {
						radar: {
							gridType: "circle",
							gridColor: "#E6E6E6",
							gridCount: 2,
							opacity: 0.2,
							max: 10,
							labelShow: true
						}
					}
				},


			}
		},
		props: {

		},

		methods: {
			// 员工能力 绘制
			drawAbilityCharts(info) {
				if (info.recordsItem.radar_max){
					this.abilityOpts.extra.radar.max = info.recordsItem.radar_max
				} else {
					this.abilityOpts.extra.radar.max = 100;
				}
				debugger
				var res = {};
				if (info.radar.length > 0){
					this.show = true;
					
					var seriesListData = [];
					var categoryList = [];
					info.radar.forEach((optionsItem, index) => {
						categoryList.push(optionsItem.name);
						seriesListData.push(optionsItem.val);
					});
					
					var seriesList = [];
					seriesList.push({
						name:'测试分析',
						data:seriesListData
						
					})
					
					
					
					
					res = {
						categories: categoryList,
						series: seriesList,
					}
					
				} else {
					debugger
					if (info.recordsItem.radarScoreList.length){
						this.show = true;
					}
					
					var series = [];
					series.push({
						name: '测试分析',
						data: info.recordsItem.radarScoreList
					});
					res = {
						categories: info.recordsItem.radarTypeList,
						series: series,
					};
				}
				
			


				this.abilityChartData = JSON.parse(JSON.stringify(res));
			},

		}
	}
</script>

<style lang='scss' scoped>

</style>